package com.bsj.travel.monitor.web;

import com.bsj.travel.monitor.file.log.LogRead;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import javax.annotation.PreDestroy;

/**
 * @author yinhao
 * @version 1.0
 * @description 初始化方法
 * @date 2024/1/24
 */
@Component
@Slf4j
public class Action implements CommandLineRunner {

    @Autowired
    private LogRead logRead;

    @Override
    public void run(String... args) throws Exception {
        logRead.start("cloudLog");
    }

    /**
     * 销毁使用的方法
     */
    @PreDestroy
    public void destroy() throws Exception {
    }
}
